add-stream ![Build Status](https://travis-ci.org/wilsonjackson/add-stream.svg?branch=master)
Append the contents of one stream onto another.
Usage
var fs = require('fs');
var es = require('event-stream');
var addStream = require('add-stream');
fs.createReadStream('1.txt')
.pipe(addStream(fs.createReadStream('2.txt')))
.pipe(fs.createWriteStream('appended.txt'));
es.readArray([1, 2, 3])
.pipe(addStream.obj(es.readArray([4, 5, 6])))
.pipe(es.writeArray(function (err, array) {
console.log(array);
}));
API
var transformStream = addStream(stream, opts = {})
Create a transform stream that appends the contents of stream
onto whatever
is piped into it. Options are passed to the transform stream's constructor.
var transformStream = addStream.obj(stream, opts = {})
A convenient shortcut for addStream(stream, {objectMode: true})
.
License
MIT